<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/mytable/fk_depart.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mytable/mytable/fk_depart.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'depid',
                footer: "Foots",
                cnName: '部门管理',
                name: 'mytable/fk_depart',
                url: "/fk_depart/",
                sortName: "depid"
            });
            const editFormFields = ref({"depname_oa":"","depid_oa":"","supdepid_oa":"","SUBCOMPANYID1_oa":""});
            const editFormOptions = ref([[{"title":"部门名称","field":"depname_oa"},
                               {"title":"部门编码-OA","field":"depid_oa","disabled":true,"type":"number"}],
                              [{"dataKey":"depart-oa","data":[],"title":"上级部门编码","field":"supdepid_oa","type":"select"},
                               {"dataKey":"subcompany","data":[],"title":"所属子公司","field":"SUBCOMPANYID1_oa","type":"select"}]]);
            const searchFormFields = ref({"depname_oa":"","depid_oa":"","supdepid_oa":"","SUBCOMPANYID1_oa":""});
            const searchFormOptions = ref([[{"title":"部门名称","field":"depname_oa","type":"like"},{"title":"部门编码-OA","field":"depid_oa","type":"number"},{"dataKey":"subcompany","data":[],"title":"所属子公司","field":"SUBCOMPANYID1_oa","type":"select"},{"dataKey":"depart-oa","data":[],"title":"上级部门编码","field":"supdepid_oa","type":"select"}]]);
            const columns = ref([{field:'depid',title:'depid',type:'int',sort:true,width:80,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'depname_oa',title:'部门名称',type:'string ',link:true,sort:true,width:30,align:'left',sort:true},
                       {field:'depid_oa',title:'部门编码-OA',type:'int',width:30,readonly:true,align:'left'},
                       {field:'supdepid_oa',title:'上级部门编码',type:'int',bind:{ key:'depart-oa',data:[]},sort:true,width:80,align:'left'},
                       {field:'SUBCOMPANYID1_oa',title:'所属子公司',type:'int',bind:{ key:'subcompany',data:[]},width:80,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
